# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-dnsknife
pkgname=('python2-dnsknife' 'python-dnsknife')
_pkgname=dnsknife
pkgver=0.12
pkgrel=7
pkgdesc='DNS tools.'
arch=('any')
url='https://pypi.org/project/dnsknife/'
license=('GPL3')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('750b091e5e2af8497f3ab7685cadd8ecdeb08858187836e34de0bdf8eba647def4f03e5a535fa3ae8037b39a587e84b9d6b4c752ccce45682be2b5f98eaaf501')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-dnsknife() {
  depends=('python2' 'python2-crypto' 'python2-requests' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-dnsknife() {
  depends=('python' 'python-crypto' 'python-requests' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

